package com.example.demo;

import com.example.demo.entity.User;
import com.example.demo.publish.PublishTest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableAsync;

@SpringBootApplication
@Slf4j
@EnableAsync
public class DemoApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(DemoApplication.class, args);
        PublishTest publishTest = applicationContext.getBean("publishTest", PublishTest.class);
        User zs = new User("zs", 10);
        publishTest.save(zs);
        log.info("执行完毕 ....");
    }

}
